<?php echo $this->render('system/user/_tab.phtml');?>
<form action="" method="post">
<?php echo $this->form()->hidden('referer', $this->referer) . "\n";?>
<div class="body">
	<table class="form">
		<tr>
			<th colspan="2"><?php echo $this->language('SYSTEM USER INFORMATION');?>:</th>
		</tr>
		<tr>
			<td width="180"><label><span class="red">*</span> <?php echo $this->language('Identity');?></label></td>
			<td><?php
				if($this->row->getId()) {
					echo '<span class="show">' . $this->row->getIdentity() . '</span>';
					echo $this->form()->hidden('identity', $this->row->getIdentity());
				} else {
					echo $this->form()->text('identity', $this->row->getIdentity(), array('size' => '30', 'maxlength' => '100'));
					echo '<code>' . $this->language('Should be the Passport number or identity, and it must be existing.') . '</code>';
				}
			?></td>
		</tr>
		<tr>
			<td><label><?php echo $this->language('Email');?></label></td>
			<td><?php echo $this->form()->text('email', $this->row->getEmail(), array('size' => '30', 'maxlength' => '100'));?></td>
		</tr>
		<tr>
			<td><label><?php echo $this->language('Nick Name');?></label></td>
			<td><?php echo $this->form()->text('nickname', $this->row->getNickname(), array('maxlength' => '50', 'size' => '30'));?></td>
		</tr>
		<tr>
			<td><label><?php echo $this->language('Timezone');?></label></td>
			<td><?php echo $this->partial('include/timezone.phtml', array('timezone' => $this->row->getTimezone()));?></td>
		</tr>
		<tr>
			<td><label><?php echo $this->language('Permisstion');?></label></td>
			<td><?php
				echo '<ul class="citem">';
				$concept = new system_user_group_concept();
				foreach($concept->fetchAll() AS $group) {
					$params = array('id' => 'permission-' . $group->getId());
					if(in_array($group->getId(), (array) $this->permissionList)) {
						$params = array_merge($params, array('checked' => 'checked'));
					}
					echo '<li>';
					echo $this->form()->checkbox('permission[]', $group->getId(), $params);
					echo '<label for="permission-' . $group->getId() . '" class="for-checkbox">' . $this->escape($group->getName()) . '</label>';
					echo '</li>';
				}
				echo '</ul>';	
			?></td>
		</tr>
		<tr>
			<td></td>
			<td colspan="2">
				<button type="submit" name="submit" value="submit"><?php echo $this->language('Submit');?></button>
				<?php
				if($this->row->getId()) {
					echo $this->render('include/deleteButton.phtml');
				}
				?>
			</td>
		</tr>
	</table>
</div>
</form>
